/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import com.openbrew.openbrewrf.views.POSSupplyView;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "AdditiveNotes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "AdditiveNotes.findAll", query = "SELECT a FROM AdditiveNotes a"),
    @NamedQuery(name = "AdditiveNotes.findByAdditiveNoteID", query = "SELECT a FROM AdditiveNotes a WHERE a.additiveNoteID = :additiveNoteID"),
    @NamedQuery(name = "AdditiveNotes.findByAdditiveNoteLbs", query = "SELECT a FROM AdditiveNotes a WHERE a.additiveNoteLbs = :additiveNoteLbs"),
    @NamedQuery(name = "AdditiveNotes.findByAdditiveNoteNotes", query = "SELECT a FROM AdditiveNotes a WHERE a.additiveNoteNotes = :additiveNoteNotes")})
public class AdditiveNotes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "additiveNoteID")
    private Integer additiveNoteID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "additiveNoteLbs")
    private float additiveNoteLbs;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 100)
    @Column(name = "additiveNoteNotes")
    private String additiveNoteNotes;
    @JoinColumn(name = "supplyID", referencedColumnName = "SupID", nullable=true)
    @ManyToOne(optional = true)
    private POSSupplyView supply;

    public AdditiveNotes() {
    }

    public AdditiveNotes(Integer additiveNoteID) {
        this.additiveNoteID = additiveNoteID;
    }

    public AdditiveNotes(Integer additiveNoteID, float additiveNoteLbs, String additiveNoteNotes) {
        this.additiveNoteID = additiveNoteID;
        this.additiveNoteLbs = additiveNoteLbs;
        this.additiveNoteNotes = additiveNoteNotes;
    }

    public Integer getAdditiveNoteID() {
        return additiveNoteID;
    }

    public void setAdditiveNoteID(Integer additiveNoteID) {
        this.additiveNoteID = additiveNoteID;
    }

    public float getAdditiveNoteLbs() {
        return additiveNoteLbs;
    }

    public void setAdditiveNoteLbs(float additiveNoteLbs) {
        this.additiveNoteLbs = additiveNoteLbs;
    }

    public String getAdditiveNoteNotes() {
        return additiveNoteNotes;
    }

    public void setAdditiveNoteNotes(String additiveNoteNotes) {
        this.additiveNoteNotes = additiveNoteNotes;
    }

    public POSSupplyView getSupply() {
        return supply;
    }

    public void setSupply(POSSupplyView supply) {
        this.supply = supply;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (additiveNoteID != null ? additiveNoteID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AdditiveNotes)) {
            return false;
        }
        AdditiveNotes other = (AdditiveNotes) object;
        if ((this.additiveNoteID == null && other.additiveNoteID != null) || (this.additiveNoteID != null && !this.additiveNoteID.equals(other.additiveNoteID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.AdditiveNotes[ additiveNoteID=" + additiveNoteID + " ]";
    }
    
}
